package com.day23.FunctionDemo;

import java.util.function.Function;

public class FunctionTest {
    public static void main(String[] args) {
        String s = "林青霞,30";
        convert(s, ss -> ss.split(","), arr -> Integer.parseInt(arr[1]), i -> i + 70);
    }

    private static void convert(String s,
                                Function<String, String[]> fun1,
                                Function<String[], Integer> fun2,
                                Function<Integer, Integer> fun3) {
        int i = fun1.andThen(fun2).andThen(fun3).apply(s);
        System.out.println(i);
    }
}